﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using Negocios;

namespace UI
{
   
    public partial class ManterVendaPacote : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          
            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            try{
        
          var v = new VendaBO();
            v.Cliente=ddlCliente.SelectedValue ;
            v.Data = Convert.ToDateTime(txtData.Text.Trim());
            v.Pacote =Convert.ToInt32(ddlPacote.SelectedValue) ;
            v.Preco =Convert.ToDecimal(txtPreço.Text.Trim());
            v.Usuario= ddlUsuario.SelectedValue;

            var vMetodos = new VendaBOMetodos ();
            vMetodos.Inserir(v);
            UpdatePanel1.Update();
        }catch(Exception ex){
        Response.Write("<script>alert('"+ex.Message +"')</script>");
        
        }
          

        }
    }
}
